08 / 13

Can an Abstract Class implement an Interface and not define all methods?

Difficulty: 3/10

Abstract Class Implementing an Interface

Yes. An abstract class can implement an interface without implementing all of its required abstract methods. The class remains abstract and passes responsibility for the remaining methods to its concrete subclasses. This is useful when the abstract class wants to provide common implementation for some interface operations while leaving specialized operations to derived classes.

javascript
  1. 1

    An abstract class can partially implement an interface.

  2. 2

    Unimplemented interface methods remain obligations for concrete subclasses.

  3. 3

    The abstract class can centralize common behavior.

  4. 4

    This pattern is useful for template-style workflows.

  5. 5

    Concrete subclasses must eventually satisfy the complete contract.

Follow-up Questions

  • Can an abstract class implement multiple interfaces?
  • Can an abstract class leave all interface methods unimplemented?
  • What is the Template Method pattern?
  • Can a concrete subclass remain abstract?
Share

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.